package com.zr.action;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.zr.service.TypeServer;
import com.zr.service.impl.TypeServerImpl;

public class AddTypeAction extends HttpServlet{

	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
	}
	
	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		int tid = Integer.parseInt(req.getParameter("tid"));
		String tname = req.getParameter("tname");
		TypeServer ts = new TypeServerImpl();
		if(!"".equals(tname))
		{
			ts.addType(tname, tid);			
		}
	}
}
